#include <stdio.h>

int BinaryFind(char *s1,int target)
{
    int right = sizeof(s1);
    int left = 0;
    while(left <= right)
    {
        int mid = left + (right - left) / 2;
        if(s1[mid] == target)
        {
            return mid;
        }
        if(s1[mid] < target)
        {
            left = mid + 1;
        }
        if(s1[mid] >target)
        {
            right = mid - 1;
        }
    }
    return -1;
}

int main()
{
    char s1[] = "abcdef";
    printf("%d\n",BinaryFind(s1,'e'));

    return 0;
}